const { resolve } = require('path')

const Router = require('koa-router')
const router = new Router()

const { MANAGE_BASEROUTER } = require(resolve(__dirname, '../config/default'))

const { verifyToken } = require(resolve(__dirname, '../middleware/index'))

const {
  aboutAdd,
  aboutFind,
  aboutUp,
  aboutDel
} = require(resolve(__dirname, '../routerHandle/managementHandle/about'))

// 查询标签 /api/manage
router.get(MANAGE_BASEROUTER + '/about/find', aboutFind)

// 增加关于信息
router.post(MANAGE_BASEROUTER + '/about/add', verifyToken, aboutAdd)

// 修改关于信息
router.post(MANAGE_BASEROUTER + '/about/update', verifyToken, aboutUp)

// 删除关于信息
router.post(MANAGE_BASEROUTER + '/about/del', verifyToken, aboutDel)

module.exports = router
